<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
	    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
	    <title>Hello APP</title>
	    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
	</head>
	<style type="text/css">
		.warp{width: 100%;}

		/*类型切换*/
		.sel-type{position: fixed;width: 100%;height: 46px;background: #FFFFFF;z-index: 999;}
		.sel-type .type-one{height: 100%;text-align: center;line-height: 46px;font-size: 15px;color: #666666;}
		.sel-type .type-one.on{color: #333333;position: relative;}
		.sel-type .type-one.on:after{display: block;content:"";width: 24px;height: 3px;border-radius:2px;background: #EB5048;position: absolute;bottom: 0;left: 50%;margin-left: -12px;}
		.fenge{width: 100%;height: 46px;background: #F6F6F6;}

		/*订单列表*/
		.tui_order-list{width: 100%;}
		.tui_order-list .order-one{width: 100%;background: #FFFFFF;margin-bottom: 10px;}
		.tui_order-list .order-one .order-top{height: 50px;width: 100%;align-items: center;padding: 0 15px;box-sizing: border-box;}
		.tui_order-list .order-one .order-top .sta{color:#FF9502;}
		.tui_order-list .order-one .order-conter{width: 100%;}
		.tui_order-list .order-one .order-conter .order-shop{padding: 20px 15px;box-sizing: border-box;background: #FFFFFF;}
		.tui_order-list .order-one .order-conter .order-shop .img-box{width: 92px;height: 92px;overflow: hidden;}
		.tui_order-list .order-one .order-conter .order-shop .img-box img{width: 100%;}
		.tui_order-list .order-one .order-conter .order-shop .shop-info{padding-left: 12px;box-sizing: border-box;position: relative;}
		.tui_order-list .order-one .order-conter .order-shop .shop-info .name{font-size: 14px;color: #333333;height: 42px;}
		.tui_order-list .order-one .order-conter .order-shop .shop-info .guige-box{align-items: center;color:#8E9194;font-size: 12px;padding-top: 2px;box-sizing: border-box;}
		.tui_order-list .order-one .order-conter .order-shop .shop-info .price{width: 100%;padding-top: 6px;box-sizing: border-box;font-size: 16px;color: #FF9502;font-weight:500;}
		.tui_order-list .order-one .order-bot{width: 100%;height: 54px;}
		.tui_order-list .order-one .order-bot .btn-box{width: 100%;height: 100%;align-items: center;justify-content: flex-end;padding: 0 15px;box-sizing: border-box;}
		.tui_order-list .order-one .order-bot .btn-box .btn{width:98px;height:34px;margin-left: 10px;border-radius:4px;background: #FF9502;;text-align: center;line-height: 34px;
		color: #ffffff;box-sizing: border-box;}
		.tui_order-list .order-one .order-bot .btn-box .btn.s{color: #999999;background: #ffffff;}
		.tui_order-list .order-one .order-bot .btn-box .btn.s::before{border-radius: 8px;border: 1px solid #CCCCCC;}
	</style>
	<body>
		<div id="vue" class="warp">

			<!--订单列表-->
			<div class="tui_order-list" style="display:none;" :style="{ display:(Pdata ? '':'none')}">
				<div class="order-one" v-for="(item,key) in Pdata.listData">
					<div class="order-top flex border-bottom" :data-id="item.id" tapmode onclick="tuiShow(this)">
						<div class="number flex1">订单编号:<i v-text="item.orderid"></i></div>
						<div class="sta" v-text="item.status_str">售后完成</div>
					</div>
					<div class="order-conter" :data-id="item.id" tapmode onclick="tuiShow(this)">
						<div class="order-shop flex border-bottom">
							<div class="img-box">
								<img :src="item.image"/>
							</div>
							<div class="shop-info flex1">
								<div class="name han_2" v-text="item.title"></div>
								<div class="guige-box flex">
									<div class="guige flex1" v-text="item.ggstr"></div>
									<div class="num">x<i v-text="item.tui_num"></i></div>
								</div>
								<div class="price">¥<i v-text="item.tui_price"></i></div>
							</div>
						</div>
					</div>
					<div class="order-bot">
						<div class="btn-box flex">
							<div class="btn s border-all" :style="{ display:(item.status <= 2 ? '':'none')}" :data-id="item.id" tapmode onclick="tuiQuxiao(this)" >取消</div>
							<div class="btn s border-all" :style="{ display:(item.status > 2 ? '':'none')}" :data-id="item.id" tapmode onclick="tuiDel(this)" >删除</div>
							<div class="btn" :data-id="item.id" tapmode onclick="tuiShow(this)">查看详情</div>
						</div>
					</div>
				</div>
			</div>

			<!--占位图-->
			<div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
				<img src="../../image/no_page/no_tuikuan.png" />
				<p>暂无订单</p>
			</div>
			<!-- 底部 -->
			<div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
				<div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
			</div>

		</div>
	</body>
</html>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">

	define(function (require, exports, module) {

		_page.getData = function(loading) {
			lanYun.getVueData({url:'UserOrderTui/list',get:{page:lanYun.page},cache:0,loading:loading},function(ret) {
				//console.log(JSON.stringify(ret));
			});
		};
		lanYun.newVue('#vue',function() {
			_page.getData(2);
		});

		//滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			var d = ret.scrollTop / 208;
			if(!ret.isToBottom) return;
			_page.getData(0);
		});

		//打开订单详情
		tuiShow = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin('ordert/tui_ordert_show.html', {
				title:"售后详情",
				border:'1',
	        	frameParam : {id:dst.id},
	        });
	    }

		//删除订单
		tuiDel = function (tis){
			var dst = tis.dataset;
			lanYun.alert({fname:'diaLogBox1',title:'提示', button:['取消','确定'],content: '您确定要删除订单吗？'},function(ret){
	            if (ret.index == 0) return;
				lanYun.get('UserOrderTui/del?id=' + dst.id ,function (ret){
					lanYun.toast(ret.msg);
					if(ret.errcode == 0){
						intGetData();
						lanYun.event('uporderNum');
					}
				},2)
	        });
		}

		//取消订单
		tuiQuxiao = function (tis){
			var dst = tis.dataset;
			lanYun.alert({fname:'diaLogBox1',title:'提示', button:['取消','确定'],content: '您确定要取消订单吗？'},function(ret){
	            if (ret.index == 0) return;
				lanYun.get('UserOrderTui/close?id=' + dst.id ,function (ret){
					lanYun.toast(ret.msg);
					if(ret.errcode == 0){
						intGetData();
						lanYun.event('uporderNum');
					}
				},2)
	        });
		}

		//刷新列表
		intGetData = function () {
			lanYun.ajaxPageSta = 0; lanYun.page = 1;
			_page.getData(2);
			lanYun.event('uporderNum');
		}

	});

</script>
